﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HOrganisationList.aspx.cs"
    Inherits="AB.ServiceDirectory.Design.Org.HOrganisationList" MasterPageFile="~/Site.Master" %>

<asp:Content ID="head" runat="server" ContentPlaceHolderID="head">
</asp:Content>
<asp:Content runat="server" ID="ContentTitle" ContentPlaceHolderID="ContentTitle"> <h2>
        Organisation List</h2></asp:Content>
<asp:Content ID="Content" ContentPlaceHolderID="Content" runat="server">
    <div class="grid740 simplebox">
        <asp:UpdatePanel runat="server">
            <ContentTemplate>
                <div class="titleh">
                    <h3 class="sorting_range">
                        <asp:LinkButton ID="LinkButtonAll" runat="server" CssClass="hg-blue" CommandName="all"
                            OnCommand="FilterByLetters_Command">All</asp:LinkButton>
                        <asp:LinkButton ID="LinkButton09" runat="server" CommandName="09" OnCommand="FilterByLetters_Command">0-9</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonAE" runat="server" CommandName="ae" OnCommand="FilterByLetters_Command">A B C D E</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonFJ" runat="server" CommandName="fj" OnCommand="FilterByLetters_Command">F G H I J</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonKN" runat="server" CommandName="kn" OnCommand="FilterByLetters_Command">K L M N</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonOR" runat="server" CommandName="or" OnCommand="FilterByLetters_Command">O P Q R</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonSV" runat="server" CommandName="sv" OnCommand="FilterByLetters_Command">S T U V</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonWZ" runat="server" CommandName="wz" CssClass="last" OnCommand="FilterByLetters_Command"> W X Y Z</asp:LinkButton>
                        <span class="right">
                            <asp:HyperLink ID="HyperLinkCreate" runat="server" CssClass="hg-blue" NavigateUrl="~/Organisation/OrganisationDetails.aspx">Create</asp:HyperLink>
                            <asp:CheckBox ID="CheckBoxInactive" runat="server" Text="Include In-active" AutoPostBack="True"
                                OnCheckedChanged="CheckBoxInactiveCheckedChanged" />
                        </span>
                    </h3>
                </div>
                <div class="clear">
                </div>
                <asp:GridView ID="GridViewOrg" CssClass="tablesorter" runat="server" AutoGenerateColumns="False"
                    AllowPaging="True" PageSize="15" AllowSorting="True" DataSourceID="ObjectDataSourceOrganisation">
                    <Columns>
                        <asp:HyperLinkField DataNavigateUrlFields="OrganisationId" DataNavigateUrlFormatString="~/Organisation/OrganisationDetail.aspx?id={0}&amp;author=hungnd12"
                            DataTextField="OrganisationName" HeaderText="Organisation Name" SortExpression="OrganisationName">
                            <HeaderStyle CssClass="header" />
                        </asp:HyperLinkField>
                        <asp:TemplateField HeaderText="Head Office Address Line 1" SortExpression="HeadOfficeAddressLine1">
                            <ItemTemplate>
                                <%#Eval("Address.AddressLine") %>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header"></HeaderStyle>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="PostCode" SortExpression="PostCode">
                            <ItemTemplate>
                                <%#Eval("Address.PostCode") %>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Contact" SortExpression="Contact">
                            <ItemTemplate>
                                <%#string.Format("{0} {1}",Eval("Contact.FirstName"),Eval("Contact.Surname")) %>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Is Active?" SortExpression="IsActive">
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%#(bool) Eval("IsActive") ? "Yes" :"No" %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" />
                        </asp:TemplateField>
                    </Columns>
                    <PagerStyle CssClass="pagination_table"></PagerStyle>
                </asp:GridView>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:ObjectDataSource ID="ObjectDataSourceOrganisation" runat="server" SelectMethod="GetOrganisation"
            TypeName="AB.ServiceDirectory.BO.HOrganisationBO" OnSelecting="ObjectDataSourceOrganisationSelecting"
            EnablePaging="true" SelectCountMethod="GetOrganisationCount" StartRowIndexParameterName="startRowIndex"
            MaximumRowsParameterName="maxRows" SortParameterName="sortType">
            <SelectParameters>
                <asp:Parameter Name="filter" Type="Object" ConvertEmptyStringToNull="False" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </div>
</asp:Content>
